﻿using Shop.Collect;
using Shop.Model.DB;
using Shop.Service.Interface;

namespace Shop.Service.lmpl
{
    internal class FrontCategoryBindService : IFrontCategoryBindService
    {
        private readonly IFrontCategoryCollect _Service;
        private readonly IFrontCategoryBindCollect _Bind;
        public FrontCategoryBindService (IFrontCategoryCollect service, IFrontCategoryBindCollect bind)
        {
            this._Bind = bind;
            this._Service = service;
        }

        public bool Set (long frontId, long[] categoryId)
        {
            DBFrontCategory front = this._Service.Get(frontId);
            return this._Bind.Set(front, categoryId);
        }
    }
}
